js.underas.controller.NumericStepper = new Class({
	"Extends":js.underas.controller.InputTextDouble
	,"maxvl":9999
	,"minvl":-9999
	,"stepvl":1
	,"initialize":function(p_text){
		var ptext = p_text||"";
		this.parent(ptext);
		this.setIcon("circle-arrow-up",1);
		this.setIcon("circle-arrow-down",2);
		this.getEle().addClass("NumericStepper");
		this.getEle(".addon2").addEvent("click",this.diminuir.bind(this));
		this.getEle(".addon1").addEvent("click",this.aumentar.bind(this));
		this.setEnable(true,1);
		this.setEnable(true,2);
		this.setEnable(true,3);
	}
	,"getVL":function(){	
		return parseInt(this.getValue());
	}
	,"setVL":function(vl){	
		if(vl >= this.minvl && vl <= this.maxvl){
			this.setValue(parseInt(vl));
			//this.htmlX.find(".inputtt").change();
		};
		if(vl <= this.minvl){
			this.setEnable(false,3);
		}else{
			this.setEnable(true,3);
		};
		if(vl >= this.maxvl){
			this.setEnable(false,1);
		}else{
			this.setEnable(true,1);
		};
	}
	,"aumentar":function(){
		if(this.isEnable(1)){
			if(this.getValue()==""){
				this.setValue(this.minvl);
			};
			this.setVL(this.getVL()+this.stepvl);
		};		
	}
	,"diminuir":function(){	 
		if(this.isEnable(3)){
			if(this.getValue()==""){
				this.setValue(this.minvl);
			};    
			this.setVL(this.getVL()-this.stepvl);
		};
	}
	,"setMin":function(vl){	     
		this.minvl = vl;
	}
	,"setMax":function(vl){	     
		this.maxvl = vl;
	}
	,"setStep":function(vl){	     
		this.stepvl = vl;
	}
});

js.underas.controller.InputMoney = new Class({
	"Extends":js.underas.controller.InputText
	,"initialize":function(p_text){
		var ptext = p_text||"";
		this.parent(ptext);
		this.setAddonText("$");
		this.setSize(3);
		this.getEle().addClass("InputMoney");
	}
});

js.underas.controller.InputEmail = new Class({
	"Extends":js.underas.controller.InputText
	,"initialize":function(p_text){
		var ptext = p_text||"";
		this.parent(ptext);
		this.setAddonText("@");
		this.setSize(6);
		this.getEle().addClass("InputEmail");
	}
	,"isValid":function(){
		if(ValidationType.EMAIL.test(this.getValue())){
			return true;
		};		
		return false;	
		
	}
});

js.underas.controller.InputTime = new Class({
	"Extends":js.underas.controller.InputText
	,"initialize":function(p_text){
		var ptext = p_text||"";
		this.parent(ptext);
		this.setIcon("time");
		this.setSize(2);
		this.setMaxLength(5);
		this.getEle().addClass("InputTime");
	}
});

js.underas.controller.InputPercent = new Class({
	"Extends":js.underas.controller.InputText
	,"initialize":function(p_text){
		var ptext = p_text||"";
		this.parent(ptext);
		this.setAddonText("%");
		this.setSize(3);
		this.getEle().addClass("InputPercent");
	}
});


js.underas.controller.InputPhone = new Class({
	"Extends":js.underas.controller.InputText
	,"initialize":function(p_text){
		var p_ddd = p_text||"";
		this.parent("(0"+p_ddd+")");
		this.setIcon("earphone");
		this.setSize(3);
		this.setMaxLength(16);
		this.getEle().addClass("InputPhone");
	}
});
